package chapter5_1;

/**
 * @author dmc
 */
public class LoopTest {
    public static void main(String[] args) {
        test1();
        test2();

    }
    public static void test1(){
        int i = 10;
        while (i < 20){
            i ++; //i = i + 1

            System.out.println("我是循环被执行了i="+ i);
        }
        System.out.println("循环结束, i= "+i);
    }
    public static void test2(){
        int i = 10;
        do{
            System.out.println("我是循环被执行了i="+ i);
            i++;
        }while (i<20);
        System.out.println("循环结束, i= "+i);
    }
}
